<?php
!defined('IN_HDWIKI') && exit('Access Denied');

class control extends base{

	function control(& $get,& $post){
		$this->base( & $get,& $post);
		$this->load('banned');
		$this->view->setlang($this->setting['lang_name'],'back');
	}
	
	function dodefault(){
		if(isset($this->post['submit'])){
			if( isset($this->post['id']) ){
				$_ENV['banned']->del_ip($this->post['id']);
			}else{
				$ip1 = $this->post['ip1new'];
				$ip2 = $this->post['ip2new'];
				$ip3 = $this->post['ip3new'];
				$ip4 = $this->post['ip4new'];
				$expiration = intval($this->post['validitynew']);			
				$_ENV['banned']->add_ip($ip1,$ip2,$ip3,$ip4,$expiration,$this->user['username']);
			}
			$this->message($this->view->lang['usermanageOptSuccess'],'index.php?admin_banned');
		}else{
			$ips = $_ENV['banned']->get_ip_list();
			$this->view->assign('ips',$ips);
			$this->view->display('admin_ipban');
		}
	}
}
?>